package com.emit.controller;

import com.emit.form.ExcelForm;
import com.emit.view.ResultView;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;

/**
 * @Author zhengshuai
 * @date 2022/1/12
 * @menu Excel
 **/
@RestController
@RequestMapping("/excel")
public class ExcelController {
    /**
     * 导出excel
     * @param excelForm 参数
     * @param response  http响应对象
     * @return  导出状态
     */
    @RequestMapping("/export")
    public ResultView<String> exportToExcel(@RequestBody ExcelForm excelForm, HttpServletResponse response){
        return new ResultView<>();
    }

    /**
     * 导入excel
     * @param excelForm  参数
     * @param file  文件
     * @return  导入状态
     */
    @RequestMapping("/import")
    public ResultView<String> importToExcel(@RequestParam("form") ExcelForm excelForm,
                                            @RequestParam("file")MultipartFile file){
        return new ResultView<>();
    }

}
